package com.dingyx.ps.task;

import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Slf4j
@Service
public class PSOrderCreateService extends PostStationRequest{
    private String version = "v1.1";
    private String serviceName = "order.create";
    Map<String, Object> params = new HashMap<>();
    /**
     * 获取点位
     */
    public String openApiMethod(){
        params.put("service", serviceName);
        return super.openApiMethod(params);
    }

    public String openApiMethod(String vmCode, List<Map<String, String>> skus, String startDay, String endDay){
        params.put("vm_id", vmCode);
        params.put("version", version);
        params.put("skus", skus);
        params.put("start_day", startDay);
        params.put("end_day", endDay);
        params.put("order_type", "immediate");
        return openApiMethod();
    }
}
